import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/exam/report/advice/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/exam/report/advice',
    method: 'post',
    data: obj
  })
}
export function submit(obj) {
  return request({
    url: '/exam/report/advice/submit',
    method: 'post',
    data: obj
  })
}

export function submitAudit(obj) {
  return request({
    url: '/exam/report/advice/submitAudit',
    method: 'post',
    data: obj
  })
}
export function submitAdvice(obj) {
  return request({
    url: '/exam/report/advice/submitAdvice',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/exam/report/advice/' + id,
    method: 'get'
  })
}
export function getAdvice(id) {
  return request({
    url: '/exam/report/advice/getAdvice/' + id,
    method: 'get'
  })
}
export function getByReportId(id) {
  return request({
    url: '/exam/report/advice/getByReportId/' + id,
    method: 'get'
  })
}
export function getAdviceByProjectId(id) {
  return request({
    url: '/exam/report/advice/getAdviceByProjectId/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/exam/report/advice/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/exam/report/advice',
    method: 'put',
    data: obj
  })
}

/**
 * 生成定稿文书
 * @param obj
 * @returns {AxiosPromise}
 */
export function genWord(obj) {
  return request({
    url: '/exam/report/advice/genWord',
    method: 'post',
    data: obj
  })
}
